package com.visionork.android.twe.activity;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class TWEActivity extends TabActivity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.twe);
		initTab();

		/*
		 * TWERepository repository = new TWERepository(); ArrayList<Program>
		 * programs = repository.getPrograms(); for (Program prog : programs) {
		 * Log.i("TWE - Program", prog.toString()); }
		 */
	}

	private void initTab() {
		TabHost tabHost = getTabHost();
		TabHost.TabSpec spec;
		Intent intent;

		Resources res = getResources();

		intent = new Intent(this, WhatsNewActivity.class);
		spec = tabHost.newTabSpec(res.getString(R.string.tab_whatsnew_tag))
				.setIndicator(res.getString(R.string.tab_whatsnew))
				.setContent(intent);
		tabHost.addTab(spec);
		
		intent = new Intent(this, FavoriteProgramActivity.class);
		spec = tabHost.newTabSpec(res.getString(R.string.tab_favorite_program_tag))
				.setIndicator(res.getString(R.string.tab_favorite_program))
				.setContent(intent);
		tabHost.addTab(spec);
		
		intent = new Intent(this, VarietyShowActivity.class);
		spec = tabHost.newTabSpec(res.getString(R.string.tab_show_tag))
				.setIndicator(res.getString(R.string.tab_show))
				.setContent(intent);

		tabHost.addTab(spec);

		intent = new Intent(this, IdolDramaActivity.class);
		spec = tabHost.newTabSpec(res.getString(R.string.tab_drama_tag))
				.setIndicator(res.getString(R.string.tab_drama))
				.setContent(intent);
		tabHost.addTab(spec);

		

		tabHost.setCurrentTabByTag(res.getString(R.string.tab_whatsnew_tag));
	}
}